﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO.IsolatedStorage;
using System.IO;


class IsolatedStorage
{
    static void Run()
    {
        IsolatedStorageFile userStorage = IsolatedStorageFile.GetUserStoreForAssembly();
        using (userStorage)
        {
            IsolatedStorageFileStream stream =
                new IsolatedStorageFileStream("example.txt", FileMode.OpenOrCreate, userStorage);
            using (stream)
            {
                // Read the isolated storage file contents
                TextReader reader = new StreamReader(stream);
                string fileContents = reader.ReadToEnd();
                Console.WriteLine("Current file contents: {0}", fileContents);

                // Modify the isolated storage file contents
              //  Console.Write("Enter a new file contents: ");
                string newFileContents = DateTime.Now.ToString();
                stream.SetLength(0);
                TextWriter writer = new StreamWriter(stream);
                using (writer)
                {
                    writer.Write(newFileContents);
                }
            }
        }
    }
    static void Main(string[] args)
    {
        Run();
    }
}
